/** 在首位添加一个或多个元素，返回长度 */
const arr = [1, 2, 3];
console.log(arr.unshift(-1, 0));
console.log(arr);

function myUnshift(...args) {
  this.splice(0, 0, ...args);
  return this.length;
}

Array.prototype.myUnshift = myUnshift;
const arr2 = [1, 2, 3];
console.log(arr2.myUnshift(-1, 0));
console.log(arr2);
